<template>
    <h2>用户借款明细</h2>
    <table class="table table-bordered">
       <tr>
        <td>用户借款编号</td>
        <td>借款用户</td>
        <td>借款项目名称</td>
        <td>借款金额</td>

       </tr>
       <tr v-for="item in list">
        <td>{{ item.UB_Id }}</td>
        <td>{{ item.UserName }}</td>
        <td>{{ item.B_Name }}</td>
        <td>{{ item.UB_Money }}</td>

       </tr>
    </table>
  </template>
  
  <script setup lang="ts">
import{reactive,toRefs,onMounted} from 'vue'
import { useRouter,useRoute } from 'vue-router'
import axios from 'axios'
import {useUserStore} from '../../store/User'
//创建store对象
const userStore=useUserStore();
let route=useRoute()
let router=useRouter()
let data:any=reactive({
        state:{
           
        },
        list:[],
      
    })
let {state,UB_Money,list}=toRefs(data)
onMounted(()=>{
        show();

})
    //反填
 const show=()=>{
        axios({
            url:"/api/Borrow/GetUserBorrow",
            method:'get',
           params:{
            bid:route.query.id
           }
        })
        .then(res=>{
            console.log(res);
            list.value=res.data.data;
        })
        .catch(err=>{
            console.log(err);   
        })
}

  </script>
  
  
  
  <style scoped>
  
  </style>